package com.manor.main.activity

import android.content.Context
import android.content.Intent
import com.manor.common.Constants
import com.manor.common.activity.AbsActivity
import com.manor.main.fragment.user.UserVideoDetailFragment
import com.manor.main.R
import kotlinx.android.synthetic.main.activity_user_sv_detail.*

/**
 *
 * @date  2020/7/15  17:22
 * @version 1.0
 */
class UserVideoDetailActivity : AbsActivity() {
    private var uid = ""
    private var dId = ""
    private var commentId = ""


    companion object {
        fun forward(context: Context, uId: String, vId: String, commentId: String) {
            Intent(context, UserVideoDetailActivity::class.java).apply {
                putExtra(Constants.TO_UID, uId)
                putExtra(Constants.DYNAMIC_ID,vId)
                putExtra(Constants.COMMENT_ID,commentId)
                context.startActivity(this)
            }
        }
    }


    override fun getLayoutId(): Int = R.layout.activity_user_sv_detail

    override fun main() {
        super.main()
        uid = intent?.getStringExtra(Constants.TO_UID)?:""
        dId = intent?.getStringExtra(Constants.DYNAMIC_ID)?:""
        commentId = intent?.getStringExtra(Constants.COMMENT_ID)?:""
        initView()
    }

    private fun initView(){
        tvBack.setOnClickListener { finish() }
        supportFragmentManager.beginTransaction()
                .replace(R.id.replace,UserVideoDetailFragment.newInstance(uid, dId, commentId))
                .commitNow()
    }


    override fun onDestroy() {
        super.onDestroy()
    }



}